﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<nelech.Models.DBModel.Feedback>>" %>
<%@ Import Namespace="nelech.Models.DBModel" %>
<script language="javascript" type="text/javascript">
        
        function Close() {
            var e = document.getElementById("mistoryCreate");
            e.style.display = "none";
        }
        function ShowFeedback(i) {
            var e = document.getElementById("mistoryFeedback" + i);
            e.style.display = e.style.display == "block" ? e.style.display = "none" : e.style.display = "block";
        }
    </script>
<div class="tguva">
  <%= Html.ActionLink("הוסף תגובה", "CreateFeedback", "Forum", ViewData["Feedback"], null)%>
   </div>
    <div class="feedbacks">
        <% var i = 1;
            if (Model != null)
           {%>
        <ol>
            <%foreach (var item in Model)
              {
            %>
            <li>
                <% if (!string.IsNullOrEmpty(item.text))
                   { %>
                <% Response.Write("<a href=\"javascript:ShowFeedback(" + i + ")\">" + item.title + "</a>");
                   }
                   else
                   {%>
                <%= item.title%>
                <span class="littleFont">(ל"ת)</span>
                <%} %>
                <div id="mistoryFeedback<%= i %>" style="display:none">
                    <%= item.text %>
                </div>
                <div>
                    <span class="forumName">
                        <%= item.username%></span> <span class="forumName">
                            <%= item.city%></span>
                    <% i++; %>
                </div>
            </li>
            <%}%></ol>
        <% }%>
    </div>

